import { instance } from '@/utils/request'

function getImgValidCode () {
  return instance.get('captcha/image')
}

export {
  getImgValidCode
}

export const sendMsgCode = (mobile, key, code) => {
  return instance.post('/captcha/sendSmsCaptcha', {
    form: {
      captchaCode: code,
      captchaKey: key,
      mobile: mobile
    }
  })
}

export const loginRequest = (mobile, msgCode) => {
  return instance.post('/passport/login', {
    form: {
      isParty: false,
      mobile: mobile,
      partyData: {},
      smsCode: msgCode
    }
  })
}
